package com.echoplots.json.config;

import java.text.SimpleDateFormat;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.fasterxml.jackson.databind.ObjectMapper;
/**
 * 
 * @author Administrator
 * @desc 自定义ObjectMapper格式化时间
 * @前:{"name":"EchoPlots","birthday":"2020-11-20T00:25:04.920+0000","age":0,"password":null}
 * @后:{"name":"EchoPlots","birthday":"2020-11-20 08:23:01","age":0,"password":null}
 */
@Configuration
public class JacksonConfig {
    @Bean
    public ObjectMapper getObjectMapper(){
        ObjectMapper mapper = new ObjectMapper();
        mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
        return mapper;
    }
}
